<%@ page language="java" contentType="text/html; charset=utf-8"
    import="com.vo.*,com.dao.*,com.daoimpl.*,java.util.*"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
	<%
	  String id=request.getParameter("id");
	  int id2=Integer.parseInt(id);
	  NewsDao dao=new NewsDaoImpl();
	  News news=dao.findNewsById(id2);
	  session.setAttribute("id", id);
	  if(dao.modifyNewsTimes(news)){
		  news=dao.findNewsById(id2);
	  }
	%>
    <h1><%=news.getTitle() %></h1>
	<p><%=news.getContent() %></p>
	<%
	if(!news.getImage().equals("NO")){
	%>
	<img src="upload/<%=news.getImage() %>" />
	<%} %>
	<h3><%=news.getDatetime() %></h3>
	
	<h3><%=news.getTimes() %></h3>
	<a href="DeleteNewsByIdServlet?id=${id}">删除新闻</a>
</body>
</html>